package com.mioto.ld.module.statistics;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author mioto-qinxj
 * @date 2024/6/16
 * @desc
 */
public class StatisticsFactory {

    private static Map<Integer, AbstractStatistics> deviceSaleMap = new ConcurrentHashMap<>(4);

    static {
        deviceSaleMap.put(1,new WeekStatistics());
        deviceSaleMap.put(2,new MonthStatistics());
        deviceSaleMap.put(3,new YearStatistics());
        deviceSaleMap.put(4,new CustomStatistics());
    }

    public static AbstractStatistics create(Integer type){
        return deviceSaleMap.get(type);
    }
}
